package UIComponents
{
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;
	
	public class UI_error extends MovieClip
	{
		private var _errorTxt:TextField;
		public function UI_error()
		{
			init();
		}
		
		private function init():void
		{
			this._errorTxt=(this.getChildByName("error_container") as DisplayObjectContainer).getChildByName("errorTxt") as TextField;
		}
		
		public function addEnterFrameEvent():void
		{
			this.gotoAndPlay(1);
			this.addEventListener(Event.ENTER_FRAME,enterFrameFun);
		}
		
		public function enterFrameFun(evt:Event):void
		{
			if(this.currentFrame==this.totalFrames)
			{
				this.removeEventListener(Event.ENTER_FRAME,enterFrameFun);
				this.dispatchEvent(new PanelEvent(PanelEvent.CLOSE,true));
			}
		}

		public function get errorTxt():TextField
		{
			return _errorTxt;
		}

		public function setErrorTxt(value:String):void
		{
			this._errorTxt.text = value;
		}


	}
}